import request from '@/utils/request'


export default{
    // 商家结算列表
    settlementList(page, size, searchMap) {
        return request({
            url: `manage/settle/shop/lists?page=${page}&size=${size}&cate_id=${searchMap.cate_id}&keyword=${searchMap.keyword}`,
            method: 'get',
        })
    },
    // 商家结算明细
    busSettDetail(page, size,data) {
        return request({
            url: `manage/settle/shop/detail?page=${page}&size=${size}&shop_id=${data.shop_id}&keyword=${data.keyword}&start_time=${data.start_time}&end_time=${data.end_time}&status=${data.status}`,
            method: 'get',
        })
    },
    // 商家结算审核列表
    busSettExamine(data,page,size) {
        return request({
            url: `manage/settle/shop/withdraw?cate_id=${data.cate_id}&keyword=${data.keyword}&name=${data.name}&status=${data.status}&page=${page}&size=${size}`,
            method: 'get',
        })
    },
    // 商家运营审核
    busSettOperate(data) {
        return request({
            url: `manage/settle/shop/businessApply`,
            method: 'post',
            data:data
        })
    },
     // 商家财务审核
    busSettFinance(data) {
        return request({
            url: `manage/settle/shop/financeApply`,
            method: 'post',
            data:data
        })
    },
    // 商家提现
    busSettWithdrawal(id) {
        return request({
            url: `manage/settle/shop/withdrawGoods?id=${id}`,
            method: 'get',
        })
    },
    // 渠道结算列表
    channelSettList(page, size, searchMap) {
        return request({
            url: `manage/settle/channel/lists?page=${page}&size=${size}&keyword=${searchMap.keyword}`,
            method: 'get',
        })
    },
    // 渠道结算明细
    chanSettDetail(data) {
        return request({
            url: `manage/settle/channel/detail?merchant_id=${data.merchant_id}&keyword=${data.keyword}&start_time=${data.start_time}&end_time=${data.end_time}&status=${data.status}`,
            method: 'get',
        })
    },
    // 渠道结算审核列表
    chanSettExamine(data) {
        return request({
            url: `manage/settle/channel/withdraw?keyword=${data.keyword}&status=${data.status}`,
            method: 'get',
        })
    },
    // 商家运营审核
    chanSettOperate(data) {
        return request({
            url: `manage/settle/channel/businessApply`,
            method: 'post',
            data:data
        })
    },
     // 渠道财务审核
    chanSettFinance(data) {
        return request({
            url: `manage/settle/shop/financeApply`,
            method: 'post',
            data:data
        })
    },
    // 渠道提现
    chanSettWithdrawal(id) {
        return request({
            url: `manage/settle/channel/withdrawGoods?id=${id}`,
            method: 'get',
        })
    },
    
    // 商家端结算列表
    busSettlementList(page,size) {
        return request({
            url: `manage/shopClient/index/settleList?page=${page}&size=${size}`,
            method: 'get',
        })
    },
    // 商家端申请提现
    withdraw() {
        return request({
            url: `manage/shopClient/index/withdraw`,
            method: 'post',
        })
    },
    // 商家端提现产品
    busWithdrawPrd(id) {
        return request({
            url: `manage/shopClient/index/withdrawGoods?id=${id}`,
            method: 'get',
        })
    },
    // 商家收银台订单
    busWithdrawCashier(id) {
        return request({
            url: `manage/settle/shop/withdrawCashier?id=${id}`,
            method: 'get',
        })
    },
    // 商家配置参数
    shopConfig() {
        return request({
            url: `manage/shopClient/index/getShopConfig`,
            method: 'get',
        })
    },
    // 渠道端申请提现
    channelWithdraw() {
        return request({
            url: `manage/settle/channel/withdrawApply`,
            method: 'post',
        })
    },
    // 渠道端提现产品
    channelWithdrawPrd(id) {
        return request({
            url: `manage/settle/channel/withdrawGoods?id=${id}`,
            method: 'get',
        })
    },
    // 渠道配置参数
    channelConfig() {
        return request({
            url: `manage/settle/channel/merchantConfig`,
            method: 'get',
        })
    },
    cashierDetail(page,size,data)
    {
        return request({
            url: `manage/settle/shop/cashierDetail?page=${page}&size=${size}`,
            data,
            method: 'post',
        })
    }
}
